With continuous development of wireless communications system technologies, to implement communication, a D2D communication mode, in addition to a conventional cellular communication mode, may also be used. In the cellular mode, a user equipment (UE) communicates with another UE by using a base station. In the D2D communication mode, UE directly communicates with another UE. For a UE, D2D communication not only saves radio resources and spectrum resources but also lowers a pressure of a core network. Therefore, a D2D technology becomes an important technology that can face the Fifth Generation (5G) and that is being currently standardized in the Third Generation Partnership Project (3GPP) standard.
In the D2D communication mode, one technology is device discovery. Device discovery refers to a process in which devices participating in D2D communication determine mutual existence before transmitting D2D information. In the prior art, devices participating in D2D communication implement device discovery under scheduling by a core network device. The core network device herein may be a base station in a cellular communications network or a similar device.
However, in some scenarios in which D2D communication is frequently applied, for example, when devices participating in D2D communication are at a position, such as a basement or an elevator hatchway, at which the devices cannot establish a wireless connection to a core network device, or at a position at which the devices establish an unstable wireless connection to a core network device, the devices participating in D2D communication have a low success probability when performing device discovery, and consequently D2D communication is affected.